<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../../org/angular.min.js"></script>
</head>

<body ng-app="app">
    <div ng-controller="ctrl">
        <span ng-bind="name"></span>
    </div>
    <script>
        //          模块名      依赖的模块
        var m = angular.module('app', []);
        // 规范依赖注入写法-避免代码压缩后出问题
        // m.controller('ctrl', ['$scope', function($scope) {
        //     $scope.name = '老周';
        // }])
        //              a可以随便变，因为是按前面$scope注入的，因为字符串是不会被压缩的
        m.controller('ctrl', ['$scope', function(a) {
            a.name = '周宇翔';
        }])
    </script>

</body>

</html>
